package school.action;

import java.util.ArrayList;
import java.util.List;

import javax.annotation.Resource;

import school.service.ISchoolService;
import base.common.BaseAction;
import base.common.PageView;
import entity.Teacher;
import entity.User;

public class SchoolTeacherFindAction  extends BaseAction{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
    ISchoolService schoolService;
    @Resource(name="user")
    User loginUser;
    
    Teacher teacher;
    
	@SuppressWarnings("unchecked")
	public String findTeacherAccount(){
		List<Teacher> list=new ArrayList<Teacher>();
		list= (List<Teacher>) schoolService.findPart(Teacher.class, currentPage,
				PAGE_SIZE, "id", "ASC", null);
		//int count=schoolService.findCount(Teacher.class);
		put("pageView", new PageView<Teacher>(currentPage, PAGE_SIZE, 2, list));
		
		return SUCCESS;
	}
	
	public String edit(){
		return "edit";
	}
	public ISchoolService getSchoolService() {
		return schoolService;
	}
	public void setSchoolService(ISchoolService schoolService) {
		this.schoolService = schoolService;
	}
	public User getLoginUser() {
		return loginUser;
	}
	public void setLoginUser(User loginUser) {
		this.loginUser = loginUser;
	}

	public Teacher getTeacher() {
		return teacher;
	}

	public void setTeacher(Teacher teacher) {
		this.teacher = teacher;
	}

	
	
}
